<? 
session_start();
include_once("secure/connect.php");
include_once("secure/functions.php");
if (!$_SESSION['logged'])
	{
	print "SESSION FERMEE";
	die;
	}

$sql_look_fiche_loc="SELECT * FROM fiches_loc WHERE id='".$_SESSION['id_fiche_loc']."'";
$res_look_fiche_loc=mysql_query($sql_look_fiche_loc,$db);
$ligne_look_fiche_loc=mysql_fetch_array ($res_look_fiche_loc);

if ($_POST['Submit'])
{
if ($_POST['type_event_select'])
{$_POST['type_event']=$_POST['type_event_select'];}

$_POST['type_event']=htmlspecialchars($_POST['type_event'], ENT_NOQUOTES);
$_POST['nom_event']=htmlspecialchars($_POST['nom_event'], ENT_NOQUOTES);
$_POST['lieu_util']=htmlspecialchars($_POST['lieu_util'], ENT_NOQUOTES);
$_POST['commentaire_out']=htmlspecialchars($_POST['commentaire_out'], ENT_NOQUOTES);
$_POST['commentaire_in']=htmlspecialchars($_POST['commentaire_in'], ENT_NOQUOTES);
$_POST['commentaire_contrat']=htmlspecialchars($_POST['commentaire_contrat'], ENT_NOQUOTES);
$infos_heures['datime_rdv_local'] =$_POST['date_rdv_local'].' '.$_POST['heure_rdv_local'];
$infos_heures['date_debut_install'] =$_POST['date_debut_install'].' '.$_POST['heure_debut_install'];
$infos_heures['duree_install']=$_POST['duree_install'];
$infos_heures['date_debut_presta'] =$_POST['date_debut_presta'].' '.$_POST['heure_debut_presta'];
$infos_heures['duree_presta']=$_POST['duree_presta'];
$infos_heures['date_debut_demontage'] =$_POST['date_debut_demontage'].' '.$_POST['heure_debut_demontage'];
$infos_heures['duree_demontage']=$_POST['duree_demontage'];
$infos_heures_imploded = implode(",",$infos_heures);

$sql_update_fiche_loc="UPDATE fiches_loc SET type_event='".$_POST['type_event']."', nom_event='".$_POST['nom_event']."', lieu_util='".$_POST['lieu_util']."', date_modif=NOW(), admin_modif='".$_SESSION['user_id']."', commentaire_out='".$_POST['commentaire_out']."', commentaire_in='".$_POST['commentaire_in']."', commentaire_contrat='".$_POST['commentaire_contrat']."', referent='".$_POST['referent']."', infos_heures_imploded='".$infos_heures_imploded."' WHERE id='".$_SESSION['id_fiche_loc']."'";
mysql_query($sql_update_fiche_loc,$db);
}

$sql_look_fiche_loc="SELECT * FROM fiches_loc WHERE id='".$_SESSION['id_fiche_loc']."'";
$res_look_fiche_loc=mysql_query($sql_look_fiche_loc,$db);
$ligne_look_fiche_loc=mysql_fetch_array ($res_look_fiche_loc);

$date_rdv_local="2007-03-31";
$heure_rdv_local="2007-01-01 19:00:00";

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Editions infos fiche</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
.droite {
	text-align: right;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: x-small;
}
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: x-small;
}
.buton {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: x-small;
}
-->
</style>
</head>

<body>
<form action="" method="post">
		<table width="405" border="1">
        		<tr>
        				<td width="128">Type d'&eacute;v&eacute;nement</td>
        				<td width="261" align="right"><div align="left">
       				      <input name="type_event" type="text" class="buton" id="type_event" value="<? echo $ligne_look_fiche_loc['type_event'];  ?>" size="50" maxlength="100">
       				      <br>       				    
       				      <select name="type_event_select" class="buton" id="type_event_select">
       				        <option value="0" selected>---</option>
       				        <option value="Soir&eacute;e priv&eacute;e">Soir&eacute;e priv&eacute;e</option>
       				        <option value="Soir&eacute;e publique gratuite">Soir&eacute;e publique gratuite</option>
       				        <option value="Soir&eacute;e publique payante">Soir&eacute;e publique payante</option>
       				        <option value="Ev&eacute;nement d'entreprise">Ev&eacute;nement d'entreprise</option>
       				        <option value="Stand">Stand</option>
       				        <option value="Prestation HC">Prestation HC</option>
	                      </select>
      				  </div></td>
   				</tr>
        		<tr>
        				<td>Nom de l'&eacute;v&eacute;nement </td>
        				<td align="right">
						
						  <div align="left">
						    <input name="nom_event" type="text" class="buton" id="nom_event" value="<? echo $ligne_look_fiche_loc['nom_event'];  ?>" size="50" maxlength="100">
				        </div></td>
   				</tr>
	<!-- temporairement effacé voi fichier pop.form.edit_infos.part.php-->
        		<tr>
                		<td> <p><strong>Livraison</strong><br>
                		  Heure<br>
               		    Adresse <br>
                		Personne de contact </p>               		    </td>
                		<td align="right">
                				<div align="left">
                				  <textarea name="lieu_util" cols="50" rows="6" class="buton" id="lieu_util"><? echo $ligne_look_fiche_loc['lieu_util'];  ?></textarea>
                				</div></td>
   				</tr>

        		<tr>
                		
                		<td colspan="2" align="right">
                				<div align="left">
                						Commentaire sortie (txt slt) <br>
               						    <textarea name="commentaire_out" cols="100" rows="5" class="buton" id="commentaire_out"><? echo $ligne_look_fiche_loc['commentaire_out'];  ?></textarea>
   						  </div></td>
   				</tr>
        		<tr>
        				
        				<td colspan="2" align="right">

						  <div align="left">
						    Commentaire retour (txt slt) <br>
					        <textarea name="commentaire_in" cols="100" rows="9" class="buton" id="commentaire_in"><? echo $ligne_look_fiche_loc['commentaire_in'];  ?></textarea>
				        </div></td>
   				</tr>
        		<tr>
        				<td colspan="2">Commentaire sur le contrat (HTML sans &lt;br&gt;) <br>
				  <textarea name="commentaire_contrat" cols="100" rows="15" class="buton" id="commentaire_contrat"><? echo $ligne_look_fiche_loc['commentaire_contrat'];  ?></textarea></td>
   				</tr>
  </table>
<p>
        		<input name="Submit" type="submit" class="buton" value="Mettre à jour">
        </p>
</form>
</body>
</html>
